#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>

#include "imbus_internal.h"
#include "im_stream.h"

static IMBool
__im_stream_def_put_void (IMStream *stream)
{
    return FALSE;
}
static IMBool
__im_stream_def_put_char (IMStream *stream, IMChar v_char)
{
    return FALSE;
}
static IMBool
__im_stream_def_put_uchar (IMStream *stream, IMUChar v_uchar)
{
    return FALSE;
}
static IMBool
__im_stream_def_put_bool (IMStream *stream, IMBool v_bool)
{
    return FALSE;
}
static IMBool
__im_stream_def_put_int16 (IMStream *stream, IMInt16 v_int16)
{
    return FALSE;
}
static IMBool
__im_stream_def_put_uint16 (IMStream *stream, IMUInt16 v_uint16)
{
    return FALSE;
}
static IMBool
__im_stream_def_put_int32 (IMStream *stream, IMInt32 v_int32)
{
    return FALSE;
}
static IMBool
__im_stream_def_put_uint32 (IMStream *stream, IMUInt32 v_uint32)
{
    return FALSE;
}
static IMBool
__im_stream_def_put_int64 (IMStream *stream, IMInt64 v_int64)
{
    return FALSE;
}
static IMBool
__im_stream_def_put_uint64 (IMStream *stream, IMUInt64 v_uint64)
{
    return FALSE;
}
static IMBool
__im_stream_def_put_double (IMStream *stream, IMDouble v_double)
{
    return FALSE;
}
static IMBool
__im_stream_def_put_c_string (IMStream *stream, const IMChar *v_string, IMSize v_length)
{
    return FALSE;
}
static IMBool
__im_stream_def_put_byte_array (IMStream *stream, const IMPointer v_array, IMSize v_size)
{
    return FALSE;
}
static IMBool
__im_stream_def_put_bool_array (IMStream *stream, const IMBool *v_array, IMSize v_size)
{
    return FALSE;
}
static IMBool
__im_stream_def_put_int16_array (IMStream *stream, const IMInt16 *v_array, IMSize v_size)
{
    return FALSE;
}
static IMBool
__im_stream_def_put_uint16_array (IMStream *stream, const IMUInt16 *v_array, IMSize v_size)
{
    return FALSE;
}
static IMBool
__im_stream_def_put_int32_array (IMStream *stream, const IMInt32 *v_array, IMSize v_size)
{
    return FALSE;
}
static IMBool
__im_stream_def_put_uint32_array (IMStream *stream, const IMUInt32 *v_array, IMSize v_size)
{
    return FALSE;
}
static IMBool
__im_stream_def_put_int64_array (IMStream *stream, const IMInt64 *v_array, IMSize v_size)
{
    return FALSE;
}
static IMBool
__im_stream_def_put_uint64_array (IMStream *stream, const IMUInt64 *v_array, IMSize v_size)
{
    return FALSE;
}
static IMBool
__im_stream_def_put_double_array (IMStream *stream, const IMDouble *v_array, IMSize v_size)
{
    return FALSE;
}
static IMBool
__im_stream_def_put_object (IMStream *stream, IMConstPointer v_object)
{
    return FALSE;
}
static void
__im_stream_def_clear (IMStream *stream)
{ }

static IMType
__im_stream_def_get_data_type (IMStream *stream)
{
    return IM_TYPE_INVALID;
}
static IMSize
__im_stream_def_get_data_size (IMStream *stream)
{
    return 0;
}
static IMBool
__im_stream_def_get_void (IMStream *stream)
{
    return FALSE;
}
static IMBool
__im_stream_def_get_char (IMStream *stream, IMChar *v_char)
{
    return FALSE;
}
static IMBool
__im_stream_def_get_uchar (IMStream *stream, IMUChar *v_uchar)
{
    return FALSE;
}
static IMBool
__im_stream_def_get_bool (IMStream *stream, IMBool *v_bool)
{
    return FALSE;
}
static IMBool
__im_stream_def_get_int16 (IMStream *stream, IMInt16 *v_int16)
{
    return FALSE;
}
static IMBool
__im_stream_def_get_uint16 (IMStream *stream, IMUInt16 *v_uint16)
{
    return FALSE;
}
static IMBool
__im_stream_def_get_int32 (IMStream *stream, IMInt32 *v_int32)
{
    return FALSE;
}
static IMBool
__im_stream_def_get_uint32 (IMStream *stream, IMUInt32 *v_uint32)
{
    return FALSE;
}
static IMBool
__im_stream_def_get_int64 (IMStream *stream, IMInt64 *v_int64)
{
    return FALSE;
}
static IMBool
__im_stream_def_get_uint64 (IMStream *stream, IMUInt64 *v_uint64)
{
    return FALSE;
}
static IMBool
__im_stream_def_get_double (IMStream *stream, IMDouble *v_double)
{
    return FALSE;
}
static IMBool
__im_stream_def_get_c_string (IMStream *stream, IMChar *v_string, IMSize v_length)
{
    if (v_string && v_length) *v_string = 0;
    return FALSE;
}
static IMBool
__im_stream_def_get_byte_array (IMStream *stream, IMPointer v_array, IMSize v_size)
{
    return FALSE;
}
static IMBool
__im_stream_def_get_bool_array (IMStream *stream, IMBool *v_array, IMSize v_size)
{
    return FALSE;
}
static IMBool
__im_stream_def_get_int16_array (IMStream *stream, IMInt16 *v_array, IMSize v_size)
{
    return FALSE;
}
static IMBool
__im_stream_def_get_uint16_array (IMStream *stream, IMUInt16 *v_array, IMSize v_size)
{
    return FALSE;
}
static IMBool
__im_stream_def_get_int32_array (IMStream *stream, IMInt32 *v_array, IMSize v_size)
{
    return FALSE;
}
static IMBool
__im_stream_def_get_uint32_array (IMStream *stream, IMUInt32 *v_array, IMSize v_size)
{
    return FALSE;
}
static IMBool
__im_stream_def_get_int64_array (IMStream *stream, IMInt64 *v_array, IMSize v_size)
{
    return FALSE;
}
static IMBool
__im_stream_def_get_uint64_array (IMStream *stream, IMUInt64 *v_array, IMSize v_size)
{
    return FALSE;
}
static IMBool
__im_stream_def_get_double_array (IMStream *stream, IMDouble *v_array, IMSize v_size)
{
    return FALSE;
}
static IMBool
__im_stream_def_get_object (IMStream *stream, IMPointer v_object)
{
    return FALSE;
}
static IMBool
__im_stream_def_skip_data (IMStream *stream)
{
    return FALSE;
}
static IMBool
__im_stream_def_rewind (IMStream *stream)
{
    return FALSE;
}
static IMBool
__im_stream_def_read (IMStream           *stream,
                      IMIOChannel        *channel,
                      IMInt              *timeout,
                      IMIOError          *error)
{
    return FALSE;
}
static IMBool
__im_stream_def_write (IMStream           *stream,
                       IMIOChannel        *channel,
                       IMInt              *timeout,
                       IMIOError          *error)
{
    return FALSE;
}
static IMSize
__im_stream_def_size (IMStream *stream)
{
    return 0;
}

static void
__im_stream_class_init (IMPointer klass)
{
    IMStreamClass *scp = (IMStreamClass *)klass;

    scp->put_void           = __im_stream_def_put_void;
    scp->put_char           = __im_stream_def_put_char;
    scp->put_uchar          = __im_stream_def_put_uchar;
    scp->put_bool           = __im_stream_def_put_bool;
    scp->put_int16          = __im_stream_def_put_int16;
    scp->put_uint16         = __im_stream_def_put_uint16;
    scp->put_int32          = __im_stream_def_put_int32;
    scp->put_uint32         = __im_stream_def_put_uint32;
    scp->put_int64          = __im_stream_def_put_int64;
    scp->put_uint64         = __im_stream_def_put_uint64;
    scp->put_double         = __im_stream_def_put_double;
    scp->put_c_string       = __im_stream_def_put_c_string;
    scp->put_byte_array     = __im_stream_def_put_byte_array;
    scp->put_bool_array     = __im_stream_def_put_bool_array;
    scp->put_int16_array    = __im_stream_def_put_int16_array;
    scp->put_uint16_array   = __im_stream_def_put_uint16_array;
    scp->put_int32_array    = __im_stream_def_put_int32_array;
    scp->put_uint32_array   = __im_stream_def_put_uint32_array;
    scp->put_int64_array    = __im_stream_def_put_int64_array;
    scp->put_uint64_array   = __im_stream_def_put_uint64_array;
    scp->put_double_array   = __im_stream_def_put_double_array;
    scp->put_object         = __im_stream_def_put_object;
    scp->clear              = __im_stream_def_clear;
    scp->get_data_type      = __im_stream_def_get_data_type;
    scp->get_data_size      = __im_stream_def_get_data_size;
    scp->get_void           = __im_stream_def_get_void;
    scp->get_char           = __im_stream_def_get_char;
    scp->get_uchar          = __im_stream_def_get_uchar;
    scp->get_bool           = __im_stream_def_get_bool;
    scp->get_int16          = __im_stream_def_get_int16;
    scp->get_uint16         = __im_stream_def_get_uint16;
    scp->get_int32          = __im_stream_def_get_int32;
    scp->get_uint32         = __im_stream_def_get_uint32;
    scp->get_int64          = __im_stream_def_get_int64;
    scp->get_uint64         = __im_stream_def_get_uint64;
    scp->get_double         = __im_stream_def_get_double;
    scp->get_c_string       = __im_stream_def_get_c_string;
    scp->get_byte_array     = __im_stream_def_get_byte_array;
    scp->get_bool_array     = __im_stream_def_get_bool_array;
    scp->get_int16_array    = __im_stream_def_get_int16_array;
    scp->get_uint16_array   = __im_stream_def_get_uint16_array;
    scp->get_int32_array    = __im_stream_def_get_int32_array;
    scp->get_uint32_array   = __im_stream_def_get_uint32_array;
    scp->get_int64_array    = __im_stream_def_get_int64_array;
    scp->get_uint64_array   = __im_stream_def_get_uint64_array;
    scp->get_double_array   = __im_stream_def_get_double_array;
    scp->get_object         = __im_stream_def_get_object;
    scp->skip_data          = __im_stream_def_skip_data;
    scp->rewind             = __im_stream_def_rewind;
    scp->read               = __im_stream_def_read;
    scp->write              = __im_stream_def_write;
    scp->size               = __im_stream_def_size;
}


void
__im_type_register_stream ()
{
    static IMTypeInfo im_stream_type_info = 
    {
        sizeof (IMStreamClass), /**< class_size >**/
        __im_stream_class_init, /**< class_init >**/
        0,                      /**< class_finalize >**/

        sizeof (IMStream),      /**< instance_size >**/
        0,                      /**< instance_init >**/
        0,                      /**< instance_finalize >**/
    };

    __im_type_register_builtin_class (IM_TYPE_OBJECT,
                                      IM_TYPE_STREAM,
                                      "Stream",
                                      &im_stream_type_info,
                                      FALSE);
}

IMStream*
im_stream_new (IMType type)
{
    IMStream *s = 0;

    _im_return_val_if_fail (type != IM_TYPE_STREAM &&
                            im_type_is_a (type, IM_TYPE_STREAM), 0);

    s = (IMStream *)im_object_new (type);

    _im_assert (s != 0);

    return s;
}

IMBool
im_stream_put_void (IMStream *stream)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->put_void (stream);
}
IMBool
im_stream_put_char (IMStream *stream, IMChar v_char)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->put_char (stream, v_char);
}
IMBool
im_stream_put_uchar (IMStream *stream, IMUChar v_uchar)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->put_uchar (stream, v_uchar);
}
IMBool
im_stream_put_bool (IMStream *stream, IMBool v_bool)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->put_bool (stream, v_bool);
}
IMBool
im_stream_put_int16 (IMStream *stream, IMInt16 v_int16)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->put_int16 (stream, v_int16);
}
IMBool
im_stream_put_uint16 (IMStream *stream, IMUInt16 v_uint16)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->put_uint16 (stream, v_uint16);
}
IMBool
im_stream_put_int32 (IMStream *stream, IMInt32 v_int32)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->put_int32 (stream, v_int32);
}
IMBool
im_stream_put_uint32 (IMStream *stream, IMUInt32 v_uint32)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->put_uint32 (stream, v_uint32);
}
IMBool
im_stream_put_int64 (IMStream *stream, IMInt64 v_int64)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->put_int64 (stream, v_int64);
}
IMBool
im_stream_put_uint64 (IMStream *stream, IMUInt64 v_uint64)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->put_uint64 (stream, v_uint64);
}
IMBool
im_stream_put_double (IMStream *stream, IMDouble v_double)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->put_double (stream, v_double);
}
IMBool
im_stream_put_c_string (IMStream *stream, const IMChar *v_string, IMSize v_length)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->put_c_string (stream, v_string, v_length);
}
IMBool
im_stream_put_byte_array (IMStream *stream, const IMPointer v_array, IMSize v_size)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->put_byte_array (stream, v_array, v_size);
}
IMBool
im_stream_put_bool_array (IMStream *stream, const IMBool *v_array, IMSize v_size)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->put_bool_array (stream, v_array, v_size);
}
IMBool
im_stream_put_int16_array (IMStream *stream, const IMInt16 *v_array, IMSize v_size)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->put_int16_array (stream, v_array, v_size);
}
IMBool
im_stream_put_uint16_array (IMStream *stream, const IMUInt16 *v_array, IMSize v_size)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->put_uint16_array (stream, v_array, v_size);
}
IMBool
im_stream_put_int32_array (IMStream *stream, const IMInt32 *v_array, IMSize v_size)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->put_int32_array (stream, v_array, v_size);
}
IMBool
im_stream_put_uint32_array (IMStream *stream, const IMUInt32 *v_array, IMSize v_size)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->put_uint32_array (stream, v_array, v_size);
}
IMBool
im_stream_put_int64_array (IMStream *stream, const IMInt64 *v_array, IMSize v_size)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->put_int64_array (stream, v_array, v_size);
}
IMBool
im_stream_put_uint64_array (IMStream *stream, const IMUInt64 *v_array, IMSize v_size)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->put_uint64_array (stream, v_array, v_size);
}
IMBool
im_stream_put_double_array (IMStream *stream, const IMDouble *v_array, IMSize v_size)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->put_double_array (stream, v_array, v_size);
}
IMBool
im_stream_put_object (IMStream *stream, IMConstPointer v_object)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->put_object (stream, v_object);
}
void
im_stream_clear (IMStream *stream)
{
    _im_return_if_fail (IM_IS_STREAM (stream));
    IM_STREAM_GET_CLASS(stream)->clear (stream);
}
IMType
im_stream_get_data_type (IMStream *stream)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), IM_TYPE_INVALID);
    return IM_STREAM_GET_CLASS(stream)->get_data_type (stream);
}
IMSize
im_stream_get_data_size (IMStream *stream)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), 0);
    return IM_STREAM_GET_CLASS(stream)->get_data_size (stream);
}
IMBool
im_stream_get_void (IMStream *stream)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->get_void (stream);
}
IMBool
im_stream_get_char (IMStream *stream, IMChar *v_char)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->get_char (stream, v_char);
}
IMBool
im_stream_get_uchar (IMStream *stream, IMUChar *v_uchar)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->get_uchar (stream, v_uchar);
}
IMBool
im_stream_get_bool (IMStream *stream, IMBool *v_bool)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->get_bool (stream, v_bool);
}
IMBool
im_stream_get_int16 (IMStream *stream, IMInt16 *v_int16)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->get_int16 (stream, v_int16);
}
IMBool
im_stream_get_uint16 (IMStream *stream, IMUInt16 *v_uint16)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->get_uint16 (stream, v_uint16);
}
IMBool
im_stream_get_int32 (IMStream *stream, IMInt32 *v_int32)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->get_int32 (stream, v_int32);
}
IMBool
im_stream_get_uint32 (IMStream *stream, IMUInt32 *v_uint32)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->get_uint32 (stream, v_uint32);
}
IMBool
im_stream_get_int64 (IMStream *stream, IMInt64 *v_int64)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->get_int64 (stream, v_int64);
}
IMBool
im_stream_get_uint64 (IMStream *stream, IMUInt64 *v_uint64)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->get_uint64 (stream, v_uint64);
}
IMBool
im_stream_get_double (IMStream *stream, IMDouble *v_double)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->get_double (stream, v_double);
}
IMBool
im_stream_get_c_string (IMStream *stream, IMChar *v_string, IMSize v_length)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->get_c_string (stream, v_string, v_length);
}
IMBool
im_stream_get_byte_array (IMStream *stream, IMPointer v_array, IMSize v_size)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->get_byte_array (stream, v_array, v_size);
}
IMBool
im_stream_get_bool_array (IMStream *stream, IMBool *v_array, IMSize v_size)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->get_bool_array (stream, v_array, v_size);
}
IMBool
im_stream_get_int16_array (IMStream *stream, IMInt16 *v_array, IMSize v_size)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->get_int16_array (stream, v_array, v_size);
}
IMBool
im_stream_get_uint16_array (IMStream *stream, IMUInt16 *v_array, IMSize v_size)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->get_uint16_array (stream, v_array, v_size);
}
IMBool
im_stream_get_int32_array (IMStream *stream, IMInt32 *v_array, IMSize v_size)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->get_int32_array (stream, v_array, v_size);
}
IMBool
im_stream_get_uint32_array (IMStream *stream, IMUInt32 *v_array, IMSize v_size)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->get_uint32_array (stream, v_array, v_size);
}
IMBool
im_stream_get_int64_array (IMStream *stream, IMInt64 *v_array, IMSize v_size)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->get_int64_array (stream, v_array, v_size);
}
IMBool
im_stream_get_uint64_array (IMStream *stream, IMUInt64 *v_array, IMSize v_size)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->get_uint64_array (stream, v_array, v_size);
}
IMBool
im_stream_get_double_array (IMStream *stream, IMDouble *v_array, IMSize v_size)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->get_double_array (stream, v_array, v_size);
}
IMBool
im_stream_get_object (IMStream *stream, IMPointer v_object)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->get_object (stream, v_object);
}
IMBool
im_stream_skip_data (IMStream *stream)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->skip_data (stream);
}
IMBool
im_stream_rewind (IMStream *stream)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->rewind (stream);
}
IMBool
im_stream_read (IMStream *stream, IMIOChannel *channel,
                IMInt *timeout, IMIOError *error)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->read (stream, channel, timeout, error);
}
IMBool
im_stream_write (IMStream *stream, IMIOChannel *channel,
                 IMInt *timeout, IMIOError *error)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), FALSE);
    return IM_STREAM_GET_CLASS(stream)->write (stream, channel, timeout, error);
}
IMSize
im_stream_size (IMStream *stream)
{
    _im_return_val_if_fail (IM_IS_STREAM (stream), 0);
    return IM_STREAM_GET_CLASS(stream)->size (stream);
}

/*
vi:ts=4:nowrap:ai:expandtab
*/
